package view.implementation;

import java.awt.Dimension;

import javax.swing.JFormattedTextField;
import javax.swing.JFrame;

import model.IMODEL;
import view.IVIEW;

public class MyFrame extends JFrame implements IVIEW {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private static MyFrame _instance;
	private JFormattedTextField txtField;
	
	public static MyFrame getInstance() {
		if (_instance == null) {
			_instance = new MyFrame();
		}
		return _instance;
	}
	
	private MyFrame()
	{
		txtField = new JFormattedTextField();
		txtField.setValue(100);
		txtField.setSize(100, 25);
		this.add(txtField);
		this.setSize(new Dimension(200, 200));
		this.setDefaultCloseOperation(MyFrame.EXIT_ON_CLOSE);
	}
	
	@Override
	public void update(IMODEL s) {
		// TODO Auto-generated method stub
		txtField.setValue(200);
	}
	
	public static void main(String[] args)
	{
		MyFrame obj = MyFrame.getInstance();
		obj.setVisible(true);
		
	}
}
